Feature: The user can edit the specific parts of the XML document

  Scenario: When I enter the '1' key in the file menu I get the edit xml declaration dialog
    When I run XML Editor interactively
    And I type "1"
    And I type "input_files/correct_file_01.xml"
    And I type "1"
    And I close the stdin stream
    Then the output should contain "Do you want to change declaration encoding?"

  Scenario: When I create a new file it has a default XML declaration
    When I launch XML Editor interactively
    And I type "2"
    And I type "new_file_test.xml"
    And I type "1"
    And I close the stdin stream
    Then the output should contain "Please enter the path for the new file:"
    And the output should contain "new_file_test.xml successfully created."
    And the output should contain "FILE MENU"
    And a file named "new_file_test.xml" should exist
    And the output should contain:
      """
      ~ Current declaration:
      <?xml version="1.0" encoding="utf-8"?>
      """

  Scenario: When I open and build an XML document model from a file, I get the exact same result when displaying it from the edit menu
    Given a file named "example.xml" with:
    """
    <?xml version="3.1" encoding="ascii-128"?>
    <gyoker/>
    """
    When I launch XML Editor interactively
    And I type "1"
    And I type "example.xml"
    And I type "2"
    And I type "a"
    And I close the stdin stream
    And the output should contain:
    """
    <?xml version="3.1" encoding="ascii-128"?>
    ~~> <gyoker/>
    """

  Scenario: When I open and build an XML document model from a file, I get the cursor displayed from the edit menu
    Given a file named "example.xml" with:
    """
    <?xml version="3.1" encoding="ascii-128"?>
    <gyoker/>
    """
    When I launch XML Editor interactively
    And I type "1"
    And I type "example.xml"
    And I type "2"
    And I type "b"
    And I close the stdin stream
    And the output should contain:
    """
    ~ node at cursor:

    ~~> <gyoker/>
    """


